class PopulateCategoryNames < ActiveRecord::Migration
  TRANSLATION = {
                  'Clothing' => 'Ropas',
                  'Men' => 'Hombres',
                  'Women' => 'Mujeres',
                  'Instruments' => 'Instrumentos',
                  'Percussions' => 'Percusiones',
                  'Jewelry' => 'Joyas',
                  'Glass' => 'Vidrio',
                  'Paintings' => 'Cuadros',
                  'Oil' => 'Pinturas al óleo',
                  'Sculptures' => 'Esculturas',
                  'People' => 'Gente'
                }
  
  def self.up
    TRANSLATION.each do |english, spanish|
      puts "English: #{english}, Spanish: #{spanish}"
      CategoryName.create :category_id => CategoryName.find_by_name_and_language(english, 'English').category.id,
        :language => 'Spanish',
        :name => spanish
    end
  end

  def self.down
    # not sure if this actually works.  oh well.
    CategoryName.destroy_all :name => TRANSLATION.values
  end
end
